package main

import (
	"fmt"
	"net/http"
	"time"
)

/*
   Author: mahaiyuan
   Date: 2021/4/19 8:22 下午
   Description:
*/

func main() {
	http.HandleFunc("/hello", hello)
	http.ListenAndServe("127.0.0.1:8888", nil)
}

func hello(writer http.ResponseWriter, request *http.Request) {
	fmt.Println("method =", request.Method)
	fmt.Println("path =", request.URL.Path)
	fmt.Println("body =", request.Body)
	writer.Write([]byte(fmt.Sprintf("hello_%d", time.Now().Unix())))
}